/* 自定义OpenAI余额显示样式 */
#custom_balance_display {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    background-color: rgba(33, 150, 243, 0.1);
    border: 1px solid rgba(33, 150, 243, 0.3);
    display: inline-block;
    animation: fadeIn 0.3s ease-in-out;
    vertical-align: middle;
    margin-left: 10px;
    transition: all 0.2s ease;
}

#custom_balance_display:hover {
    background-color: rgba(33, 150, 243, 0.2);
    border-color: rgba(33, 150, 243, 0.5);
}

#custom_balance_display:active {
    transform: translateY(0);
    background-color: rgba(33, 150, 243, 0.3);
}

#custom_balance_display:empty {
    display: none;
}

#refresh_custom_balance {
    transition: all 0.2s ease;
}

#refresh_custom_balance:hover {
    color: #2196F3;
    transform: scale(1.1);
}

#refresh_custom_balance.fa-spin {
    color: #FFA500;
}

/* 余额状态颜色 */
.balance-success {
    color: #4caf50 !important;
    border-color: rgba(76, 175, 80, 0.3) !important;
    background-color: rgba(76, 175, 80, 0.1) !important;
}

.balance-success:hover {
    background-color: rgba(76, 175, 80, 0.2) !important;
    border-color: rgba(76, 175, 80, 0.5) !important;
}

.balance-warning {
    color: #ff9800 !important;
    border-color: rgba(255, 152, 0, 0.3) !important;
    background-color: rgba(255, 152, 0, 0.1) !important;
}

.balance-warning:hover {
    background-color: rgba(255, 152, 0, 0.2) !important;
    border-color: rgba(255, 152, 0, 0.5) !important;
}

.balance-error {
    color: #f44336 !important;
    border-color: rgba(244, 67, 54, 0.3) !important;
    background-color: rgba(244, 67, 54, 0.1) !important;
}

.balance-error:hover {
    background-color: rgba(244, 67, 54, 0.2) !important;
    border-color: rgba(244, 67, 54, 0.5) !important;
}

.balance-loading {
    color: #FFA500 !important;
    border-color: rgba(255, 165, 0, 0.3) !important;
    background-color: rgba(255, 165, 0, 0.1) !important;
}

.balance-loading:hover {
    background-color: rgba(255, 165, 0, 0.2) !important;
    border-color: rgba(255, 165, 0, 0.5) !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-2px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    #custom_balance_display {
        font-size: 11px;
        padding: 1px 6px;
        margin-left: 5px !important;
    }

    #refresh_custom_balance {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }
}

/* 深色主题适配 */
@media (prefers-color-scheme: dark) {
    #custom_balance_display {
        background-color: rgba(33, 150, 243, 0.15);
        border-color: rgba(33, 150, 243, 0.4);
    }

    #custom_balance_display:hover {
        background-color: rgba(33, 150, 243, 0.25);
        border-color: rgba(33, 150, 243, 0.6);
    }

    .balance-success {
        background-color: rgba(76, 175, 80, 0.15) !important;
        border-color: rgba(76, 175, 80, 0.4) !important;
    }

    .balance-success:hover {
        background-color: rgba(76, 175, 80, 0.25) !important;
        border-color: rgba(76, 175, 80, 0.6) !important;
    }

    .balance-warning {
        background-color: rgba(255, 152, 0, 0.15) !important;
        border-color: rgba(255, 152, 0, 0.4) !important;
    }

    .balance-warning:hover {
        background-color: rgba(255, 152, 0, 0.25) !important;
        border-color: rgba(255, 152, 0, 0.6) !important;
    }

    .balance-error {
        background-color: rgba(244, 67, 54, 0.15) !important;
        border-color: rgba(244, 67, 54, 0.4) !important;
    }

    .balance-error:hover {
        background-color: rgba(244, 67, 54, 0.25) !important;
        border-color: rgba(244, 67, 54, 0.6) !important;
    }

    .balance-loading {
        background-color: rgba(255, 165, 0, 0.15) !important;
        border-color: rgba(255, 165, 0, 0.4) !important;
    }

    .balance-loading:hover {
        background-color: rgba(255, 165, 0, 0.25) !important;
        border-color: rgba(255, 165, 0, 0.6) !important;
    }
}
